﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SAM.Framework.ExportData
{
    /// <summary>
    /// 导出excel通用接口
    /// </summary>
    public interface IExportExcel:IDisposable
    {
        /// <summary>
        /// 根据list列表生成Excel数据
        /// </summary>
        /// <typeparam name="T">对象类型</typeparam>
        /// <param name="list">对象列表</param>
        /// <param name="option">生成的配置选项</param>
        /// <returns></returns>
        System.IO.MemoryStream Generate<T>(IList<T> list, ExportOption<T,PropertyInfo> option);

        /// <summary>
        /// 根据DataTable列表生成Excel数据
        /// </summary>
        /// <param name="data">数据集合</param>
        /// <param name="option">生成的配置选项</param>
        /// <returns></returns>
        System.IO.MemoryStream GenerateOfDataTable(System.Data.DataTable data, ExportOption<System.Data.DataRow, System.Data.DataColumn> option);
    }
}
